package com.gec.zhs.controller;

import java.util.List;

import com.gec.zhs.entity.query.FlowinstanceoperationhistoryQuery;
import com.gec.zhs.entity.po.Flowinstanceoperationhistory;
import com.gec.zhs.entity.vo.ResponseVO;
import com.gec.zhs.service.FlowinstanceoperationhistoryService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 工作流实例操作记录 Controller
 */
@RestController("flowinstanceoperationhistoryController")
@RequestMapping("/flowinstanceoperationhistory")
public class FlowinstanceoperationhistoryController extends ABaseController{

	@Resource
	private FlowinstanceoperationhistoryService flowinstanceoperationhistoryService;
	/**
	 * 根据条件分页查询
	 */
	@RequestMapping("/loadDataList")
	public ResponseVO loadDataList(FlowinstanceoperationhistoryQuery query){
		return getSuccessResponseVO(flowinstanceoperationhistoryService.findListByPage(query));
	}

	/**
	 * 新增
	 */
	@RequestMapping("/add")
	public ResponseVO add(Flowinstanceoperationhistory bean) {
		flowinstanceoperationhistoryService.add(bean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 批量新增
	 */
	@RequestMapping("/addBatch")
	public ResponseVO addBatch(@RequestBody List<Flowinstanceoperationhistory> listBean) {
		flowinstanceoperationhistoryService.addBatch(listBean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 批量新增/修改
	 */
	@RequestMapping("/addOrUpdateBatch")
	public ResponseVO addOrUpdateBatch(@RequestBody List<Flowinstanceoperationhistory> listBean) {
		flowinstanceoperationhistoryService.addBatch(listBean);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据Id查询对象
	 */
	@RequestMapping("/getFlowinstanceoperationhistoryById")
	public ResponseVO getFlowinstanceoperationhistoryById(String id) {
		return getSuccessResponseVO(flowinstanceoperationhistoryService.getFlowinstanceoperationhistoryById(id));
	}

	/**
	 * 根据Id修改对象
	 */
	@RequestMapping("/updateFlowinstanceoperationhistoryById")
	public ResponseVO updateFlowinstanceoperationhistoryById(Flowinstanceoperationhistory bean,String id) {
		flowinstanceoperationhistoryService.updateFlowinstanceoperationhistoryById(bean,id);
		return getSuccessResponseVO(null);
	}

	/**
	 * 根据Id删除
	 */
	@RequestMapping("/deleteFlowinstanceoperationhistoryById")
	public ResponseVO deleteFlowinstanceoperationhistoryById(String id) {
		flowinstanceoperationhistoryService.deleteFlowinstanceoperationhistoryById(id);
		return getSuccessResponseVO(null);
	}
}